(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
double(0') → 0'
double(s(x)) → s(s(double(x)))
log(0') → logError
log(s(x)) → loop(s(x), s(0'), 0')
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
double(0') → 0'
double(s(x)) → s(s(double(x)))
log(0') → logError
log(s(x)) → loop(s(x), s(0'), 0')
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
le,
double,
loopThey will be analysed ascendingly in the following order:
le < loop
double < loop
(6) Obligation:
Innermost TRS:
Rules:
le(
s(
x),
0') →
falsele(
0',
y) →
truele(
s(
x),
s(
y)) →
le(
x,
y)
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
log(
0') →
logErrorlog(
s(
x)) →
loop(
s(
x),
s(
0'),
0')
loop(
x,
s(
y),
z) →
if(
le(
x,
s(
y)),
x,
s(
y),
z)
if(
true,
x,
y,
z) →
zif(
false,
x,
y,
z) →
loop(
x,
double(
y),
s(
z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
Generator Equations:
gen_s:0':logError3_0(0) ⇔ 0'
gen_s:0':logError3_0(+(x, 1)) ⇔ s(gen_s:0':logError3_0(x))
The following defined symbols remain to be analysed:
le, double, loop
They will be analysed ascendingly in the following order:
le < loop
double < loop
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
le(
gen_s:0':logError3_0(
+(
1,
n5_0)),
gen_s:0':logError3_0(
n5_0)) →
false, rt ∈ Ω(1 + n5
0)
Induction Base:
le(gen_s:0':logError3_0(+(1, 0)), gen_s:0':logError3_0(0)) →RΩ(1)
false
Induction Step:
le(gen_s:0':logError3_0(+(1, +(n5_0, 1))), gen_s:0':logError3_0(+(n5_0, 1))) →RΩ(1)
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) →IH
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
le(
s(
x),
0') →
falsele(
0',
y) →
truele(
s(
x),
s(
y)) →
le(
x,
y)
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
log(
0') →
logErrorlog(
s(
x)) →
loop(
s(
x),
s(
0'),
0')
loop(
x,
s(
y),
z) →
if(
le(
x,
s(
y)),
x,
s(
y),
z)
if(
true,
x,
y,
z) →
zif(
false,
x,
y,
z) →
loop(
x,
double(
y),
s(
z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
Lemmas:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
Generator Equations:
gen_s:0':logError3_0(0) ⇔ 0'
gen_s:0':logError3_0(+(x, 1)) ⇔ s(gen_s:0':logError3_0(x))
The following defined symbols remain to be analysed:
double, loop
They will be analysed ascendingly in the following order:
double < loop
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
double(
gen_s:0':logError3_0(
n318_0)) →
gen_s:0':logError3_0(
*(
2,
n318_0)), rt ∈ Ω(1 + n318
0)
Induction Base:
double(gen_s:0':logError3_0(0)) →RΩ(1)
0'
Induction Step:
double(gen_s:0':logError3_0(+(n318_0, 1))) →RΩ(1)
s(s(double(gen_s:0':logError3_0(n318_0)))) →IH
s(s(gen_s:0':logError3_0(*(2, c319_0))))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
le(
s(
x),
0') →
falsele(
0',
y) →
truele(
s(
x),
s(
y)) →
le(
x,
y)
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
log(
0') →
logErrorlog(
s(
x)) →
loop(
s(
x),
s(
0'),
0')
loop(
x,
s(
y),
z) →
if(
le(
x,
s(
y)),
x,
s(
y),
z)
if(
true,
x,
y,
z) →
zif(
false,
x,
y,
z) →
loop(
x,
double(
y),
s(
z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
Lemmas:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
double(gen_s:0':logError3_0(n318_0)) → gen_s:0':logError3_0(*(2, n318_0)), rt ∈ Ω(1 + n3180)
Generator Equations:
gen_s:0':logError3_0(0) ⇔ 0'
gen_s:0':logError3_0(+(x, 1)) ⇔ s(gen_s:0':logError3_0(x))
The following defined symbols remain to be analysed:
loop
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol loop.
(14) Obligation:
Innermost TRS:
Rules:
le(
s(
x),
0') →
falsele(
0',
y) →
truele(
s(
x),
s(
y)) →
le(
x,
y)
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
log(
0') →
logErrorlog(
s(
x)) →
loop(
s(
x),
s(
0'),
0')
loop(
x,
s(
y),
z) →
if(
le(
x,
s(
y)),
x,
s(
y),
z)
if(
true,
x,
y,
z) →
zif(
false,
x,
y,
z) →
loop(
x,
double(
y),
s(
z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
Lemmas:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
double(gen_s:0':logError3_0(n318_0)) → gen_s:0':logError3_0(*(2, n318_0)), rt ∈ Ω(1 + n3180)
Generator Equations:
gen_s:0':logError3_0(0) ⇔ 0'
gen_s:0':logError3_0(+(x, 1)) ⇔ s(gen_s:0':logError3_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
(16) BOUNDS(n^1, INF)
(17) Obligation:
Innermost TRS:
Rules:
le(
s(
x),
0') →
falsele(
0',
y) →
truele(
s(
x),
s(
y)) →
le(
x,
y)
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
log(
0') →
logErrorlog(
s(
x)) →
loop(
s(
x),
s(
0'),
0')
loop(
x,
s(
y),
z) →
if(
le(
x,
s(
y)),
x,
s(
y),
z)
if(
true,
x,
y,
z) →
zif(
false,
x,
y,
z) →
loop(
x,
double(
y),
s(
z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
Lemmas:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
double(gen_s:0':logError3_0(n318_0)) → gen_s:0':logError3_0(*(2, n318_0)), rt ∈ Ω(1 + n3180)
Generator Equations:
gen_s:0':logError3_0(0) ⇔ 0'
gen_s:0':logError3_0(+(x, 1)) ⇔ s(gen_s:0':logError3_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
(19) BOUNDS(n^1, INF)
(20) Obligation:
Innermost TRS:
Rules:
le(
s(
x),
0') →
falsele(
0',
y) →
truele(
s(
x),
s(
y)) →
le(
x,
y)
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
log(
0') →
logErrorlog(
s(
x)) →
loop(
s(
x),
s(
0'),
0')
loop(
x,
s(
y),
z) →
if(
le(
x,
s(
y)),
x,
s(
y),
z)
if(
true,
x,
y,
z) →
zif(
false,
x,
y,
z) →
loop(
x,
double(
y),
s(
z))
Types:
le :: s:0':logError → s:0':logError → false:true
s :: s:0':logError → s:0':logError
0' :: s:0':logError
false :: false:true
true :: false:true
double :: s:0':logError → s:0':logError
log :: s:0':logError → s:0':logError
logError :: s:0':logError
loop :: s:0':logError → s:0':logError → s:0':logError → s:0':logError
if :: false:true → s:0':logError → s:0':logError → s:0':logError → s:0':logError
hole_false:true1_0 :: false:true
hole_s:0':logError2_0 :: s:0':logError
gen_s:0':logError3_0 :: Nat → s:0':logError
Lemmas:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
Generator Equations:
gen_s:0':logError3_0(0) ⇔ 0'
gen_s:0':logError3_0(+(x, 1)) ⇔ s(gen_s:0':logError3_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0':logError3_0(+(1, n5_0)), gen_s:0':logError3_0(n5_0)) → false, rt ∈ Ω(1 + n50)
(22) BOUNDS(n^1, INF)